<extend name="Layout/page_detail" />
<block name="content">
	{:W('PageHeader/search',array('name'=>'流程管理','search'=>'S'))}
	<!--  功能操作区域  -->
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left" >
				<div class="btn-group">
					<a class="btn btn-sm btn-primary  dropdown-toggle" data-toggle="dropdown" href="#"> 移动到 <span class="fa fa-caret-down"></span> </a>
					<ul class="dropdown-menu">
						<foreach name="tag_list" item="vo">
							<li onclick="move_to('{$key}');">
								<a>{$vo}</a>
							</li>
						</foreach>
					</ul>
				</div>
				<a class="btn btn-sm btn-danger" onclick="del();">删除</a>
			</div >
			<div class="pull-right">
				<a  onclick="add();" class="btn btn-sm btn-primary">新建</a>
			</div>
		</div>
	</div>
	<!-- 功能操作区域结束 -->
	<div class="ul_table border-bottom">
		<ul>
			<li class="thead"  >
				<label class="inline pull-left col-3">
					<input class="ace" type="checkbox" name="id-toggle-all" id="id-toggle-all" />
					<span class="lbl"></span></label>
				<span class="col-14">分组 </span>
				<div class="pull-right">
					<span  class="col-25">文档编号规则</span>
					<span class="col-6 text-center">状态</span>
					<span class="col-6 text-center">字段管理</span>
				</div>
				<span class="autocut auto">名称</span>
			</li>
			<empty name="list">
				<li class="no-data">
					没找到数据
				</li>
				<else/>
				<form method="post" action="" name="form_data" id="form_data">
					<foreach name="list" item="vo">
						<li class="tbody" >
							<label class="inline pull-left col-3">
								<input class="ace" type="checkbox" name="id[]" value="{$vo.id}" />
								<span class="lbl"></span></label>
							<span  class="col-14" >{$vo.tag_name}&nbsp;</span>
							<div class="pull-right">
								<span class="col-25">{$vo.doc_no_format }&nbsp;</span>
								<span class="col-6 text-center"  >{$vo.is_del|status}&nbsp;</span>
								<a class="col-6 text-center" href="{:U('Flow/field_manage','row_type='.$vo['id'])}">字段管理</a></span>
							</div >
							<span class="autocut auto"><a href="{:U('edit','id='.$vo['id'])}">{$vo.name}&nbsp;</a></span>
						</li>
					</foreach>
				</form>
			</empty>
		</ul>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function add() {
			window.open("{:U('add')}", "_self");
		}

		function btn_search() {
			$("#form_search").submit();
		}

		function del() {
			var vars = $("#form_data").serialize();
			ui_confirm('确定要删除吗?', function() {
				sendAjax("{:U('del')}", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							location.reload(true);
						});
					}
				});
			});
		}

		function move_to(val) {
			var vars = $("#form_data").serialize();
			sendAjax("{:U('move_to')}", "val=" + val + '&' + vars, function(data) {
				if (data.status) {
					ui_alert(data.info, function() {
						location.reload(true);
					});
				} else {
					ui_alert(data.info);
				}
			});
		}


		$(document).ready(function() {
			set_return_url();
		});
	</script>
</block>